// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   PostRowMapper.java

package dale.web.post.repository;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import dale.web.category.domain.Category;
import dale.web.post.domain.Post;

public class PostRowMapper
    implements RowMapper<Post>
{

    public PostRowMapper()
    {
    }

    public Post mapRow(ResultSet rs, int rowNum) throws SQLException
    {
        Category category = new Category();
        category.setCategoryID(rs.getString("categoryID"));
        category.setName(rs.getString("name"));
        Post note = new Post();
        note.setPostNo(rs.getInt("postNo"));
        note.setCategory(category);
        note.setTitle(rs.getString("title"));
        note.setContent(rs.getString("content"));
        note.setDate(rs.getTimestamp("date"));
        return note;
    }

}
